package com.luiz.gymmoves;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.actionbarsherlock.R;
import com.luiz.gymmoves.pojo.User;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ArrayAdapter;
import android.widget.CompoundButton;
import android.widget.DatePicker;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.CompoundButton.OnCheckedChangeListener;
import android.widget.RadioButton;

public class RegisterActivity extends Activity{
	
	public RadioButton rbLocal;
	public RadioButton rbOnline;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.register);
		
		rbLocal = (RadioButton) findViewById(R.id.radioButtonLocal);
		rbLocal.setChecked(true);
		rbLocal.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				rbOnline.setChecked(false);
			}
		});
		rbOnline = (RadioButton) findViewById(R.id.radioButtonOnline);
		rbOnline.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				rbLocal.setChecked(false);
			}
		});
		
	}
	
	public void registerUser(View v) {
		TextView tvUser = (TextView) findViewById(R.id.textViewRegisterUser);
		TextView tvPwd = (TextView) findViewById(R.id.textViewRegisterPwd);
		DatePicker dp = (DatePicker) findViewById(R.id.datePicker1);
		
		User user = new User();
		user.setNome(tvUser.getText().toString());
		user.setPassword(tvPwd.getText().toString());
		user.setDataNasc(new Date(dp.getYear(), dp.getMonth(), dp.getDayOfMonth()).getTime());
		
	}
	
	
}
